<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libxlsxwriter: chart_data_labels.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libxlsxwriter
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">chart_data_labels.c</div>  </div>
</div><!--header-->
<div class="contents">
<table width="600">
<tr>
<td><a class="el" href="chart_data_tools_8c-example.html">&lt;&lt; chart_data_tools.c</a> </td><td align="right"><a class="el" href="chart_fonts_8c-example.html">chart_fonts.c &gt;&gt;</a>  </td></tr>
</table>
<p>A demo of an various Excel chart data label features that are available via a libxlsxwriter chart, including custom data labels.</p>
<p>Chart 1: chart with standard data labels. </p><div class="image">
<img src="chart_data_labels11.png" alt=""/>
</div>
<p>Chart 2: chart with Category and Value data labels. </p><div class="image">
<img src="chart_data_labels12.png" alt=""/>
</div>
<p>Chart 3: chart with data labels with a user defined font. </p><div class="image">
<img src="chart_data_labels13.png" alt=""/>
</div>
<p>Chart 4: chart with data labels and formatting. </p><div class="image">
<img src="chart_data_labels22.png" alt=""/>
</div>
<p>Chart 5: chart with custom string data labels. </p><div class="image">
<img src="chart_data_labels14.png" alt=""/>
</div>
<p>Chart 6: chart with custom data labels referenced from worksheet cells. </p><div class="image">
<img src="chart_data_labels15.png" alt=""/>
</div>
<p>Chart 7: chart with a mix of custom and default labels. The items initialized with '{0}' and items without a custom label (points 5 and 6 which come after NULL) will get the default value. We also set a font for the custom items as an extra example. </p><div class="image">
<img src="chart_data_labels16.png" alt=""/>
</div>
<p>Chart 8: chart with some deleted custom labels and defaults. </p><div class="image">
<img src="chart_data_labels17.png" alt=""/>
</div>
<p>Chart 9: chart with custom string data labels and formatting. </p><div class="image">
<img src="chart_data_labels23.png" alt=""/>
</div>
<div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"> * A demo of an various Excel chart data label features that are available via</span></div>
<div class="line"><span class="comment"> * a libxlsxwriter chart.</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Copyright 2014-2020, John McNamara, jmcnamara@cpan.org</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;xlsxwriter.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"> * Create a worksheet with examples charts.</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"><span class="keywordtype">int</span> main() {</div>
<div class="line"> </div>
<div class="line">    <a name="_a0"></a><a class="code" href="structlxw__workbook.html">lxw_workbook</a>     *workbook  = <a name="a1"></a><a class="code" href="workbook_8h.html#a1cf96608a23ee4eb0e8467c15240d00b">workbook_new</a>(<span class="stringliteral">&quot;chart_data_labels.xlsx&quot;</span>);</div>
<div class="line">    <a name="_a2"></a><a class="code" href="structlxw__worksheet.html">lxw_worksheet</a>    *worksheet = <a name="a3"></a><a class="code" href="workbook_8h.html#a81d456b4f65a464e78e4a0030ecc3c2e">workbook_add_worksheet</a>(workbook, NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a bold format to use to highlight the header cells. */</span></div>
<div class="line">    <a name="_a4"></a><a class="code" href="structlxw__format.html">lxw_format</a> *bold = <a name="a5"></a><a class="code" href="workbook_8h.html#a279a5d7075d09a3931aae9782afede33">workbook_add_format</a>(workbook);</div>
<div class="line">    <a name="a6"></a><a class="code" href="format_8h.html#a85e1b0baf44b445b65894e48722aec14">format_set_bold</a>(bold);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Some chart positioning options. */</span></div>
<div class="line">    <a name="_a7"></a><a class="code" href="structlxw__chart__options.html">lxw_chart_options</a> options = {.<a name="a8"></a><a class="code" href="structlxw__chart__options.html#a1bad76e66248d60d07a26e9bb963232f">x_offset</a> = 25,  .y_offset = 10};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Write some data for the chart. */</span></div>
<div class="line">    <a name="a9"></a><a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 0, 0, <span class="stringliteral">&quot;Number&quot;</span>,  bold);</div>
<div class="line">    <a name="a10"></a><a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 1, 0, 2,         NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 2, 0, 3,         NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 3, 0, 4,         NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 4, 0, 5,         NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 5, 0, 6,         NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 6, 0, 7,         NULL);</div>
<div class="line"> </div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 0, 1, <span class="stringliteral">&quot;Data&quot;</span>,    bold);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 1, 1, 20,        NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 2, 1, 10,        NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 3, 1, 20,        NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 4, 1, 30,        NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 5, 1, 40,        NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 6, 1, 30,        NULL);</div>
<div class="line"> </div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 0, 2, <span class="stringliteral">&quot;Text&quot;</span>,    bold);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 1, 2, <span class="stringliteral">&quot;Jan&quot;</span>,     NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 2, 2, <span class="stringliteral">&quot;Feb&quot;</span>,     NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 3, 2, <span class="stringliteral">&quot;Mar&quot;</span>,     NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 4, 2, <span class="stringliteral">&quot;Apr&quot;</span>,     NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 5, 2, <span class="stringliteral">&quot;May&quot;</span>,     NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, 6, 2, <span class="stringliteral">&quot;Jun&quot;</span>,     NULL);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 1. Example with standard data labels.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    <a name="_a11"></a><a class="code" href="structlxw__chart.html">lxw_chart</a> *chart = <a name="a12"></a><a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a name="a13"></a><a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a name="a14"></a><a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Chart with standard data labels&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    <a name="_a15"></a><a class="code" href="structlxw__chart__series.html">lxw_chart_series</a> *series = <a name="a16"></a><a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                                       <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a name="a17"></a><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a name="a18"></a><a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a name="a19"></a><a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a name="a20"></a><a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a name="a21"></a><a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D2&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 2. Example with value and category data labels.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Category and Value data labels&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn on Value and Category labels. */</span></div>
<div class="line">    <a name="a22"></a><a class="code" href="chart_8h.html#aede723351fb3f426cd0ef2b891fc6726">chart_series_set_labels_options</a>(series, <a name="a23"></a><a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>, <a name="a24"></a><a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D18&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 3. Example with standard data labels with different font.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Data labels with user defined font&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <a name="_a25"></a><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font1 = {.<a name="a26"></a><a class="code" href="structlxw__chart__font.html#abca1be9b66dcd9bc4558cc97556456b5">bold</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>, .color = <a name="a27"></a><a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>, .rotation = -30};</div>
<div class="line">    <a name="a28"></a><a class="code" href="chart_8h.html#aea2957adf1e8c754f771bbcb836229d4">chart_series_set_labels_font</a>(series, &amp;font1);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D34&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 4. Example with standard data labels and formatting.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Data labels with formatting&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Set the border/line and fill for the data labels. */</span></div>
<div class="line">    <a name="_a29"></a><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line1 = {.<a name="a30"></a><a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line">    <a name="_a31"></a><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill1 = {.<a name="a32"></a><a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a name="a33"></a><a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a>};</div>
<div class="line"> </div>
<div class="line">    <a name="a34"></a><a class="code" href="chart_8h.html#a4476eee2a69555f7eac7f716d179fad6">chart_series_set_labels_line</a>(series, &amp;line1);</div>
<div class="line">    <a name="a35"></a><a class="code" href="chart_8h.html#add8ab9f6f62a3de270b8d17bd2748217">chart_series_set_labels_fill</a>(series, &amp;fill1);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D50&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 5.Example with custom string data labels.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Chart with custom string data labels&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create some custom labels. */</span></div>
<div class="line">    <a name="_a36"></a><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5_1 = {.<a name="a37"></a><a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Amy&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5_2 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Bea&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5_3 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Eva&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5_4 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Fay&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5_5 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Liv&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5_6 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Una&quot;</span>};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create an array of label pointers. NULL indicates the end of the array. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels5[] = {</div>
<div class="line">        &amp;data_label5_1,</div>
<div class="line">        &amp;data_label5_2,</div>
<div class="line">        &amp;data_label5_3,</div>
<div class="line">        &amp;data_label5_4,</div>
<div class="line">        &amp;data_label5_5,</div>
<div class="line">        &amp;data_label5_6,</div>
<div class="line">        NULL</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Set the custom labels. */</span></div>
<div class="line">    <a name="a38"></a><a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels5);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D66&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 6. Example with custom data labels from cells.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Chart with custom data labels from cells&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create some custom labels. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6_1 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$2&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6_2 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$3&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6_3 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$4&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6_4 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$5&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6_5 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$6&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6_6 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$7&quot;</span>};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create an array of label pointers. NULL indicates the end of the array. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels6[] = {</div>
<div class="line">        &amp;data_label6_1,</div>
<div class="line">        &amp;data_label6_2,</div>
<div class="line">        &amp;data_label6_3,</div>
<div class="line">        &amp;data_label6_4,</div>
<div class="line">        &amp;data_label6_5,</div>
<div class="line">        &amp;data_label6_6,</div>
<div class="line">        NULL</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Set the custom labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels6);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D82&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 7. Example with custom and default data labels.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Mixed custom and default data labels&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font2 = {.<a name="a39"></a><a class="code" href="structlxw__chart__font.html#a7921a876ed780271df6e0f4bca8e38f5">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create some custom labels. */</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* The following is used to get a mix of default and custom labels. The</span></div>
<div class="line"><span class="comment">     * items initialized with &#39;{0}&#39; and items without a custom label (points 5</span></div>
<div class="line"><span class="comment">     * and 6 which come after NULL) will get the default value. We also set a</span></div>
<div class="line"><span class="comment">     * font for the custom items as an extra example.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label7_1 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$2&quot;</span>, .font = &amp;font2};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label7_2 = {0};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label7_3 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$4&quot;</span>, .font = &amp;font2};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label7_4 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$5&quot;</span>, .font = &amp;font2};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create an array of label pointers. NULL indicates the end of the array. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels7[] = {</div>
<div class="line">        &amp;data_label7_1,</div>
<div class="line">        &amp;data_label7_2,</div>
<div class="line">        &amp;data_label7_3,</div>
<div class="line">        &amp;data_label7_4,</div>
<div class="line">        NULL</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Set the custom labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels7);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D98&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 8. Example with deleted/hidden custom data labels.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Chart with deleted data labels&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create some custom labels. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> hide = {.<a name="a40"></a><a class="code" href="structlxw__chart__data__label.html#a4cd68183846a54e6fa95edc8ba873ec9">hide</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> keep = {.<a class="code" href="structlxw__chart__data__label.html#a4cd68183846a54e6fa95edc8ba873ec9">hide</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* An initialized struct like this would also work: */</span></div>
<div class="line">    <span class="comment">/* lxw_chart_data_label keep = {0}; */</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create an array of label pointers. NULL indicates the end of the array. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels8[] = {</div>
<div class="line">        &amp;hide,</div>
<div class="line">        &amp;keep,</div>
<div class="line">        &amp;hide,</div>
<div class="line">        &amp;hide,</div>
<div class="line">        &amp;keep,</div>
<div class="line">        &amp;hide,</div>
<div class="line">        NULL</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Set the custom labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels8);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D114&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*</span></div>
<div class="line"><span class="comment">     * Chart 9.Example with custom string data labels and formatting.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a chart title. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Chart with custom labels and formatting&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add a data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$2:$A$7&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$2:$B$7&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the series data labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Set the border/line and fill for the data labels. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line2 = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line">    <a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill2 = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a>};</div>
<div class="line">    <a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line3 = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a name="a41"></a><a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37">LXW_COLOR_BLUE</a>};</div>
<div class="line">    <a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill3 = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a name="a42"></a><a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871">LXW_COLOR_GREEN</a>};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create some custom labels. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_1 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Amy&quot;</span>, .line = &amp;line3};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_2 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Bea&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_3 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Eva&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_4 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Fay&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_5 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Liv&quot;</span>};</div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_6 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Una&quot;</span>, .fill = &amp;fill3};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Set the default formatting for the data labels in the series. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#a4476eee2a69555f7eac7f716d179fad6">chart_series_set_labels_line</a>(series, &amp;line2);</div>
<div class="line">    <a class="code" href="chart_8h.html#add8ab9f6f62a3de270b8d17bd2748217">chart_series_set_labels_fill</a>(series, &amp;fill2);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create an array of label pointers. NULL indicates the end of the array. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels9[] = {</div>
<div class="line">        &amp;data_label9_1,</div>
<div class="line">        &amp;data_label9_2,</div>
<div class="line">        &amp;data_label9_3,</div>
<div class="line">        &amp;data_label9_4,</div>
<div class="line">        &amp;data_label9_5,</div>
<div class="line">        &amp;data_label9_6,</div>
<div class="line">        NULL</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Set the custom labels. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels9);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Turn off the legend. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D130&quot;</span>), chart, &amp;options);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> <a name="a43"></a><a class="code" href="workbook_8h.html#ad9e7aeebc0fd43562db5bcd527b2ee5e">workbook_close</a>(workbook);</div>
<div class="line">}</div>
</div><!-- fragment --> </div><!-- contents -->
<div class="ttc" id="aworkbook_8h_html_ad9e7aeebc0fd43562db5bcd527b2ee5e"><div class="ttname"><a href="workbook_8h.html#ad9e7aeebc0fd43562db5bcd527b2ee5e">workbook_close</a></div><div class="ttdeci">lxw_error workbook_close(lxw_workbook *workbook)</div><div class="ttdoc">Close the Workbook object and write the XLSX file.</div></div>
<div class="ttc" id="achart_8h_html_adcaf0404fe7cd5c9e49a7b7025c64a35"><div class="ttname"><a href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a></div><div class="ttdeci">lxw_error chart_series_set_labels_custom(lxw_chart_series *series, lxw_chart_data_label *data_labels[])</div><div class="ttdoc">Set the properties for data labels in a series.</div></div>
<div class="ttc" id="astructlxw__chart__options_html"><div class="ttname"><a href="structlxw__chart__options.html">lxw_chart_options</a></div><div class="ttdoc">Options for inserted charts.</div><div class="ttdef"><b>Definition:</b> worksheet.h:1301</div></div>
<div class="ttc" id="achart_8h_html_aea2957adf1e8c754f771bbcb836229d4"><div class="ttname"><a href="chart_8h.html#aea2957adf1e8c754f771bbcb836229d4">chart_series_set_labels_font</a></div><div class="ttdeci">void chart_series_set_labels_font(lxw_chart_series *series, lxw_chart_font *font)</div><div class="ttdoc">Set the font properties for chart data labels in a series.</div></div>
<div class="ttc" id="acommon_8h_html_a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4"><div class="ttname"><a href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a></div><div class="ttdeci">@ LXW_FALSE</div><div class="ttdef"><b>Definition:</b> common.h:51</div></div>
<div class="ttc" id="astructlxw__chart__data__label_html_a084f083e48841fa41d109a4601441460"><div class="ttname"><a href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">lxw_chart_data_label::value</a></div><div class="ttdeci">char * value</div><div class="ttdef"><b>Definition:</b> chart.h:800</div></div>
<div class="ttc" id="achart_8h_html_ad60de0eb056e93435407e91482115f55"><div class="ttname"><a href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a></div><div class="ttdeci">lxw_chart_series * chart_add_series(lxw_chart *chart, const char *categories, const char *values)</div><div class="ttdoc">Add a data series to a chart.</div></div>
<div class="ttc" id="astructlxw__chart__options_html_a1bad76e66248d60d07a26e9bb963232f"><div class="ttname"><a href="structlxw__chart__options.html#a1bad76e66248d60d07a26e9bb963232f">lxw_chart_options::x_offset</a></div><div class="ttdeci">int32_t x_offset</div><div class="ttdef"><b>Definition:</b> worksheet.h:1304</div></div>
<div class="ttc" id="aworkbook_8h_html_a1cf96608a23ee4eb0e8467c15240d00b"><div class="ttname"><a href="workbook_8h.html#a1cf96608a23ee4eb0e8467c15240d00b">workbook_new</a></div><div class="ttdeci">lxw_workbook * workbook_new(const char *filename)</div><div class="ttdoc">Create a new workbook object.</div></div>
<div class="ttc" id="astructlxw__chart__font_html_a7921a876ed780271df6e0f4bca8e38f5"><div class="ttname"><a href="structlxw__chart__font.html#a7921a876ed780271df6e0f4bca8e38f5">lxw_chart_font::color</a></div><div class="ttdeci">lxw_color_t color</div><div class="ttdef"><b>Definition:</b> chart.h:723</div></div>
<div class="ttc" id="aformat_8h_html_a85e1b0baf44b445b65894e48722aec14"><div class="ttname"><a href="format_8h.html#a85e1b0baf44b445b65894e48722aec14">format_set_bold</a></div><div class="ttdeci">void format_set_bold(lxw_format *format)</div><div class="ttdoc">Turn on bold for the format font.</div></div>
<div class="ttc" id="astructlxw__chart__line_html"><div class="ttname"><a href="structlxw__chart__line.html">lxw_chart_line</a></div><div class="ttdoc">Struct to represent a chart line.</div><div class="ttdef"><b>Definition:</b> chart.h:639</div></div>
<div class="ttc" id="achart_8h_html_a4476eee2a69555f7eac7f716d179fad6"><div class="ttname"><a href="chart_8h.html#a4476eee2a69555f7eac7f716d179fad6">chart_series_set_labels_line</a></div><div class="ttdeci">void chart_series_set_labels_line(lxw_chart_series *series, lxw_chart_line *line)</div><div class="ttdoc">Set the line properties for the data labels in a chart series.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a></div><div class="ttdeci">@ LXW_COLOR_YELLOW</div><div class="ttdef"><b>Definition:</b> format.h:226</div></div>
<div class="ttc" id="astructlxw__chart__font_html"><div class="ttname"><a href="structlxw__chart__font.html">lxw_chart_font</a></div><div class="ttdoc">Struct to represent a chart font.</div><div class="ttdef"><b>Definition:</b> chart.h:699</div></div>
<div class="ttc" id="astructlxw__worksheet_html"><div class="ttname"><a href="structlxw__worksheet.html">lxw_worksheet</a></div><div class="ttdoc">Struct to represent an Excel worksheet.</div><div class="ttdef"><b>Definition:</b> worksheet.h:1603</div></div>
<div class="ttc" id="astructlxw__chart__data__label_html"><div class="ttname"><a href="structlxw__chart__data__label.html">lxw_chart_data_label</a></div><div class="ttdoc">Struct to represent an Excel chart data label.</div><div class="ttdef"><b>Definition:</b> chart.h:796</div></div>
<div class="ttc" id="astructlxw__format_html"><div class="ttname"><a href="structlxw__format.html">lxw_format</a></div><div class="ttdoc">Struct to represent the formatting properties of an Excel format.</div><div class="ttdef"><b>Definition:</b> format.h:358</div></div>
<div class="ttc" id="acommon_8h_html_a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf"><div class="ttname"><a href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a></div><div class="ttdeci">@ LXW_TRUE</div><div class="ttdef"><b>Definition:</b> common.h:53</div></div>
<div class="ttc" id="astructlxw__chart_html"><div class="ttname"><a href="structlxw__chart.html">lxw_chart</a></div><div class="ttdoc">Struct to represent an Excel chart.</div><div class="ttdef"><b>Definition:</b> chart.h:1086</div></div>
<div class="ttc" id="astructlxw__chart__series_html"><div class="ttname"><a href="structlxw__chart__series.html">lxw_chart_series</a></div><div class="ttdoc">Struct to represent an Excel chart data series.</div><div class="ttdef"><b>Definition:</b> chart.h:957</div></div>
<div class="ttc" id="astructlxw__chart__fill_html_a1780f71f3de68cb03e2f2825952283e4"><div class="ttname"><a href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">lxw_chart_fill::color</a></div><div class="ttdeci">lxw_color_t color</div><div class="ttdef"><b>Definition:</b> chart.h:666</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871">LXW_COLOR_GREEN</a></div><div class="ttdeci">@ LXW_COLOR_GREEN</div><div class="ttdef"><b>Definition:</b> format.h:196</div></div>
<div class="ttc" id="achart_8h_html_ac8f7f044cc9d893568e9d4c9fcf13aa9"><div class="ttname"><a href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a></div><div class="ttdeci">void chart_series_set_labels(lxw_chart_series *series)</div><div class="ttdoc">Add data labels to a chart series.</div></div>
<div class="ttc" id="astructlxw__chart__fill_html"><div class="ttname"><a href="structlxw__chart__fill.html">lxw_chart_fill</a></div><div class="ttdoc">Struct to represent a chart fill.</div><div class="ttdef"><b>Definition:</b> chart.h:663</div></div>
<div class="ttc" id="astructlxw__chart__line_html_a2619e85b4ece41f55302b5bc8157d738"><div class="ttname"><a href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">lxw_chart_line::color</a></div><div class="ttdeci">lxw_color_t color</div><div class="ttdef"><b>Definition:</b> chart.h:642</div></div>
<div class="ttc" id="astructlxw__workbook_html"><div class="ttname"><a href="structlxw__workbook.html">lxw_workbook</a></div><div class="ttdoc">Struct to represent an Excel workbook.</div><div class="ttdef"><b>Definition:</b> workbook.h:273</div></div>
<div class="ttc" id="aworksheet_8h_html_a4e8ea2614bc214fa0cc8992733c51f5f"><div class="ttname"><a href="worksheet_8h.html#a4e8ea2614bc214fa0cc8992733c51f5f">worksheet_insert_chart_opt</a></div><div class="ttdeci">lxw_error worksheet_insert_chart_opt(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, lxw_chart *chart, lxw_chart_options *user_options)</div><div class="ttdoc">Insert a chart object into a worksheet, with options.</div></div>
<div class="ttc" id="achart_8h_html_af1382251c31fd8f97e19048acf5db0a1"><div class="ttname"><a href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a></div><div class="ttdeci">void chart_legend_set_position(lxw_chart *chart, uint8_t position)</div><div class="ttdoc">Set the position of the chart legend.</div></div>
<div class="ttc" id="achart_8h_html_aede723351fb3f426cd0ef2b891fc6726"><div class="ttname"><a href="chart_8h.html#aede723351fb3f426cd0ef2b891fc6726">chart_series_set_labels_options</a></div><div class="ttdeci">void chart_series_set_labels_options(lxw_chart_series *series, uint8_t show_name, uint8_t show_category, uint8_t show_value)</div><div class="ttdoc">Set the display options for the labels of a data series.</div></div>
<div class="ttc" id="achart_8h_html_aa0a0b3eadc51a608c76bb9473943e191"><div class="ttname"><a href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a></div><div class="ttdeci">void chart_title_set_name(lxw_chart *chart, const char *name)</div><div class="ttdoc">Set the title of the chart.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37">LXW_COLOR_BLUE</a></div><div class="ttdeci">@ LXW_COLOR_BLUE</div><div class="ttdef"><b>Definition:</b> format.h:184</div></div>
<div class="ttc" id="astructlxw__chart__font_html_abca1be9b66dcd9bc4558cc97556456b5"><div class="ttname"><a href="structlxw__chart__font.html#abca1be9b66dcd9bc4558cc97556456b5">lxw_chart_font::bold</a></div><div class="ttdeci">uint8_t bold</div><div class="ttdef"><b>Definition:</b> chart.h:708</div></div>
<div class="ttc" id="aworksheet_8h_html_ac208046e7a6d12cc87982422efa41b31"><div class="ttname"><a href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a></div><div class="ttdeci">lxw_error worksheet_write_string(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, const char *string, lxw_format *format)</div><div class="ttdoc">Write a string to a worksheet cell.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a></div><div class="ttdeci">@ LXW_COLOR_RED</div><div class="ttdef"><b>Definition:</b> format.h:217</div></div>
<div class="ttc" id="aworksheet_8h_html_ad9fc47d3beaa2ab4759414e8580c2289"><div class="ttname"><a href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a></div><div class="ttdeci">lxw_error worksheet_write_number(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, double number, lxw_format *format)</div><div class="ttdoc">Write a number to a worksheet cell.</div></div>
<div class="ttc" id="astructlxw__chart__data__label_html_a4cd68183846a54e6fa95edc8ba873ec9"><div class="ttname"><a href="structlxw__chart__data__label.html#a4cd68183846a54e6fa95edc8ba873ec9">lxw_chart_data_label::hide</a></div><div class="ttdeci">uint8_t hide</div><div class="ttdef"><b>Definition:</b> chart.h:804</div></div>
<div class="ttc" id="autility_8h_html_ad510ac6df573d23203374e24dba373d2"><div class="ttname"><a href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a></div><div class="ttdeci">#define CELL(cell)</div><div class="ttdoc">Convert an Excel A1 cell string into a (row, col) pair.</div><div class="ttdef"><b>Definition:</b> utility.h:45</div></div>
<div class="ttc" id="aworkbook_8h_html_a81d456b4f65a464e78e4a0030ecc3c2e"><div class="ttname"><a href="workbook_8h.html#a81d456b4f65a464e78e4a0030ecc3c2e">workbook_add_worksheet</a></div><div class="ttdeci">lxw_worksheet * workbook_add_worksheet(lxw_workbook *workbook, const char *sheetname)</div><div class="ttdoc">Add a new worksheet to a workbook.</div></div>
<div class="ttc" id="aworkbook_8h_html_a63b001ecefdbc4417986a3e344657726"><div class="ttname"><a href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a></div><div class="ttdeci">lxw_chart * workbook_add_chart(lxw_workbook *workbook, uint8_t chart_type)</div><div class="ttdoc">Create a new chart to be added to a worksheet:</div></div>
<div class="ttc" id="achart_8h_html_aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4"><div class="ttname"><a href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22a8077ef4a20bd15141f6b747f12ea17a4">LXW_CHART_LEGEND_NONE</a></div><div class="ttdeci">@ LXW_CHART_LEGEND_NONE</div><div class="ttdef"><b>Definition:</b> chart.h:167</div></div>
<div class="ttc" id="aworkbook_8h_html_a279a5d7075d09a3931aae9782afede33"><div class="ttname"><a href="workbook_8h.html#a279a5d7075d09a3931aae9782afede33">workbook_add_format</a></div><div class="ttdeci">lxw_format * workbook_add_format(lxw_workbook *workbook)</div><div class="ttdoc">Create a new Format object to formats cells in worksheets.</div></div>
<div class="ttc" id="achart_8h_html_add8ab9f6f62a3de270b8d17bd2748217"><div class="ttname"><a href="chart_8h.html#add8ab9f6f62a3de270b8d17bd2748217">chart_series_set_labels_fill</a></div><div class="ttdeci">void chart_series_set_labels_fill(lxw_chart_series *series, lxw_chart_fill *fill)</div><div class="ttdoc">Set the fill properties for the data labels in a chart series.</div></div>
<div class="ttc" id="achart_8h_html_a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a"><div class="ttname"><a href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cafa7f69bde9c99b5818297c64e8b9070a">LXW_CHART_COLUMN</a></div><div class="ttdeci">@ LXW_CHART_COLUMN</div><div class="ttdef"><b>Definition:</b> chart.h:113</div></div>
<!-- HTML footer for doxygen 1.8.20-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Copyright 2014-2020 John McNamara.
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
